<?php
use yii\helpers\Url;

$web = Url::base();

?>
<script type="application/javascript">

    //var walfareId = '';
    var detailPage = 1;
    var totalPage = 1;
    var filter = '';

    $(function ($) {
        loading.hide();
        walfareId = "<?= $walfare_sumarry['id'] ?>";
        searchUser();
    });

    //搜索 积分详情里面的搜索人员
    function searchUser(i) {
        //var institutionCode = $("#select2").val();
        loading.show();
        var filter;
        var f = $('#searchUser').val()._trim();
        if (f == '') {
            filter = 0;
        } else {
            filter = f;
        }
        var data = {};
        data.id = walfareId;
        data.filter = filter;
        if (i != 1) {
            detailPage = 1;
        }
        data.page = detailPage;
        requestHtml('walfare-detail-partview', data, true, function (responseHtml) {
            $("#detailTable").html(responseHtml);
            loading.hide();
        });
    }

</script>

<div class="panel panel-default">
    <div class="panel-body">
        <div class="row">
            <div class="col-lg-4">
                <b>福利名称：</b><?= $walfare_sumarry['walfare_name'] ?>
                <br>
                <b>发放时间：</b><?= $walfare_sumarry['create_time'] ?>
                <br>
                <b>操&nbsp;&nbsp;作&nbsp;&nbsp;人：</b><?= $walfare_sumarry['create_user_name'] ?>
                <br>
                <b>所属机构：</b><?= $walfare_sumarry['name'] . '  ' . $walfare_sumarry['department_name'] ?>
            </div>
            <div class="col-lg-4">
                <b>发放总人数：</b><code><?= $walfare_sumarry['totalnum'] ?></code>
                <br>
                <b>发放总分数：</b><code><?= $walfare_sumarry['totalsum'] ?></code><?= $walfare_sumarry['integral_unit'] ?>
                <br>
                <b>发放总金额：</b><code><?= $walfare_sumarry['totalmoney'] ?></code>元&nbsp;&nbsp;(1元=<?= $walfare_sumarry['integral_rate'] ?><?= $walfare_sumarry['integral_unit'] ?>
                )
            </div>

            <div class="col-lg-4">
                <div class="input-group">
                    <input type="text" class="form-control" id="searchUser" placeholder="请输入用户名或手机号码"
                           onkeypress="if(event.keyCode==13) {searchUser();return false;}">
                        <span class="input-group-btn">
                            <button type="submit" class="btn btn-primary" onclick="searchUser()"><i
                                    class="fa fa-search"></i> 搜索
                            </button>
                        </span>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="panel">
    <div class="panel-body" id="detailTable">

    </div>
    </div>